﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.Text;
using NyBio.Model;
using NyBio.DB;

namespace NyBio.Ctrl
{
    public class TicketCtrl
    {
        private TicketDB ticketDB;

        public TicketCtrl()
        {
            ticketDB = new TicketDB();
        }

        public void addTicket(Ticket ticket)
        {
            ticketDB.insertTicket(ticket);
        }

        public void insertTicket(Ticket ticket)
        {
            ticketDB.insertTicket(ticket);
        }

        public void removeTicket(int id)
        {
            ticketDB.removeTicket(id);
        }

        public void updateTicket(Ticket ticket)
        {
            ticketDB.updateTicket(ticket);
        }

        public Ticket getTicketById(string id)
        {
            return ticketDB.getTicketById(Convert.ToInt32(id));
        }

        public List<Ticket> getTickets()
        {
            return ticketDB.getTickets();
        }

        public List<Ticket> getTicketsBySchedule(int scheduleId)
        {
            return ticketDB.getTicketsBySchedule(scheduleId);
        }
        
    }
}